﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace btmerc.API.Schemas
{
    public partial class Vehicle
    {
        public ushort MaintenanceTimeNeeded
        {
            get
            {
                return 0;
            }
        }

        public IEnumerable<Component> GetComponents()
        {
            throw new NotImplementedException();
        }

        public TechBase GetHighestTechBase()
        {
            var components = GetComponents();
            if (components.Where(c => c.TechBase == TechBase.Clan).Any())
            {
                return TechBase.Clan;
            }
            else if (components.Where(c => c.TechBase == TechBase.IS2).Any())
            {
                return TechBase.IS2;
            }
            else
            {
                return TechBase.IS1;
            }
        }
    }
}
